package com.example.arithmeticleetcode.leetcode.august;

/**
 * @program: arithmetic-leetcode
 * @description:
 * @author: FangZhen
 * @create: 2020-08-19 11:53
 **/
public class Demo08 {

    public static void main(String[] args) {
        int[] arr = {1, 2, 3};
        threeConsecutiveOdds(arr);
    }

    public static boolean threeConsecutiveOdds(int[] arr) {
        if (arr.length < 3) {
            return false;
        }
        for (int i = 0, len = arr.length - 3; i <= len; i++) {
            if (arr[i] % 2 != 0 && arr[i + 1] % 2 != 0 && arr[i + 2] % 2 != 0) {
                return true;
            }
        }
        return false;
    }
}
